import { request, http } from '.'

/*
首页
*/



export const getStoreList = async (data: {page: number, pageSize: number}) => {
	return request('/api/v1/store/list', 'GET', data)
}

export const getStoreInfo = async (id: number) => {
	return request(`/api/v1/store/${id}`, 'GET', {})
}

/*
* 登陆注册相关
*/
export const getCode = async (phone: string) => { // 获取注册验证码
	return http(`/api/v1/verifycode/signup/phone/${phone}`, 'POST', {})
}

export const getLoginCode = async (phone: string) => { // 获取登录验证码 
	return http(`/api/v1/verifycode/login/phone/${phone}`, 'POST', {})
}



export const register = async (data: {
	phone: string, 
	verificationCode: string, 
	invitationCode: string, 
	loginPassword: string,
	confirmLoginPassword: string
	}) => { // 注册
	return http('/api/v1/phone/signup', 'POST', data)
}

export const login = async (data: { phone: string, verificationCode: string}) => { // 登录
	return http('/api/v1/phone/login', 'POST', data)
}
